
public class Student {

	private int numberOfQuizes;
	private double totalscore;
	private String name;

	public Student(String name) {
		if (name.equals(null))
			throw new IllegalArgumentException();
		else {
			this.name = name;
		}
	}

	public String getName() {
		return this.name;
	}

	public double getAverage() {
		double Average;
		if (this.numberOfQuizes <= 0) {
			throw new UnsupportedOperationException();
			// System.exit(0);
		} else
			Average = this.totalscore / this.numberOfQuizes;
		return Average;

	}

	public void addQuiz(double x) {
		if (x < 0) {
			throw new IllegalArgumentException();

		} else {
			this.totalscore += x;
			numberOfQuizes++;
		}
	}

	public double getTotalScore() {
		return this.totalscore;
	}

	public void setNumberOfQuizes(int num) {
		this.numberOfQuizes = num;
	}

}